#ifndef QNXWINDOW_H
#define QNXWINDOW_H

#include "Core/Window.h"
// #include "Hazel/Renderer/GraphicsContext.h"

namespace CC
{

	class QnxWindow : public Window
	{
	public:
		QnxWindow(const WindowProps &props);
		virtual ~QnxWindow();

		void OnUpdate() override;

		unsigned int GetWidth() const override { return m_Data.Width; }
		unsigned int GetHeight() const override { return m_Data.Height; }

		// Window attributes
		void SetEventCallback(const EventCallbackFn &callback) override { m_Data.EventCallback = callback; }
		void SetVSync(bool enabled) override;
		bool IsVSync() const override;

		virtual void *GetNativeWindow() const { return m_Window; }

	private:
		virtual void Init(const WindowProps &props);
		virtual void Shutdown();

	private:
		int m_Window;

		EGLDisplay egl_disp;
		EGLConfig egl_conf;
		EGLSurface egl_surf;
		EGLContext egl_ctx;

		screen_context_t screen_ctx;
		screen_window_t screen_win;
		screen_event_t screen_ev;
		int pause = 0;

		int rc;
		// Scope<GraphicsContext> m_Context;

		struct WindowData
		{
			std::string Title;
			unsigned int Width, Height;
			bool VSync;

			EventCallbackFn EventCallback;
		};

		WindowData m_Data;
	};

}

#endif